package httpdata

import "net/http"

///
// 缓存库默认返回
///

// Found 错误信息
var Found map[int][]byte

func init() {
	Found = make(map[int][]byte)
	// 404 默认错误
	Found[http.StatusNotFound] = []byte(`<!DOCTYPE HTML><html><head><meta charset="utf-8"><meta name="viewport"content="width=device-width, initial-scale=1"><title>404错误</title></head><script>function ErrorToSubmit(){window.location.href="/ErrorToSubmit?URL="+window.location.href}</script><style>html,body{width:100%;height:100%;margin:0;padding:0}body{display:flex;align-items:center;justify-content:center}.left-right-middle1{width:200px;margin:0 auto}.dow{width:100px;height:40px;border-radius:15px;background:#5B3F69;color:#FFFC00;text-decoration:none;border:3px;cursor:pointer}.dow:hover{background:#EE82EE}.dow:active{background:#EE82EE}</style><div class="body"style="color:#FF00FF;text-align:center;"><p>o(一︿一+)o请不要随便访问啦ヽ(*。>Д<)o゜</p><p>(っ*` + "´Д`" + `)っ您访问的资源已经消失了Σ(°△°|||)︴</p><div class="left-right-middle1"style="width:300px; height:50px;"><a class="dow"style="float:left;line-height:35px;"href="/">返回首页</a><a class="dow"style="float:right;line-height:35px;"onclick="ErrorToSubmit()">提交错误</a></div></div></html>`)
}

// GetFound 得到状态
func GetFound(id int) []byte {
	if b, ok := Found[id]; ok {
		return b
	}
	return []byte("")
}
